package com.ruoyi.system.controller;


import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.domain.DataAboutAllUs;
import com.ruoyi.system.domain.DataAward;
import com.ruoyi.system.domain.DataPatent;
import com.ruoyi.system.domain.DataProject;
import com.ruoyi.system.service.IDataAwardService;
import com.ruoyi.system.service.IDataPatentService;
import com.ruoyi.system.service.IDataProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/aboutUsPage")
public class AboutUs {


    @Autowired
    private IDataAwardService iDataAwardService;
    @Autowired
    private IDataPatentService iDataPatentService;
    @Autowired
    private IDataProjectService iDataProjectService;


    @RequestMapping("/getInfo")
    public AjaxResult getInfo()
    {
        List<DataAward> dataAwards = new ArrayList<>();
        List<DataPatent> dataPatents = new ArrayList<>();
        List<DataProject> dataProjects = new ArrayList<>();


        dataAwards = iDataAwardService.selectAllDataAwardList();
        dataPatents = iDataPatentService.selectAllDataPatentList();
        dataProjects = iDataProjectService.selectAllDataProjectList();

        DataAboutAllUs dataAboutAllUs = new DataAboutAllUs();
        dataAboutAllUs.setDataAwards(dataAwards);
        dataAboutAllUs.setDataPatents(dataPatents);
        dataAboutAllUs.setDataProjects(dataProjects);

        return AjaxResult.success(dataAboutAllUs);
    }
}
